package net.jiupinshi.service.user.impl;

import net.jiupinshi.dao.ExpenseApplyDao;
import net.jiupinshi.dto.ExpenseApplyDTO;
import net.jiupinshi.dto.StoreSimpleDTO;
import net.jiupinshi.dto.UserDTO;
import net.jiupinshi.entity.ExpenseApply;
import net.jiupinshi.entity.Store;
import net.jiupinshi.service.user.ExpenseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Despription: 需要修改
 * @Author: penghui.guo
 * @Date: 2018/10/6 18:33
 */
@Service
public class ExpenseApplyServiceImpl implements ExpenseApplyService{

    @Autowired
    ExpenseApplyDao expenseApplyDao;

    @Override
    public List<ExpenseApplyDTO> getExpenseApplys(String startDate, String endDate, Long applyUserId, Long storeId, byte status,Long expenseUserId, int start, int count) {
        return expenseApplyDao.getExpenseApplys(startDate, endDate, applyUserId, storeId, status, expenseUserId, start, count);
    }

    @Override
    public int getExpenseApplysCount(String startDate, String endDate, Long applyUserId, Long storeId, byte status, Long expenseUserId) {
        return expenseApplyDao.getExpenseApplysCount(startDate, endDate, applyUserId, storeId, status, expenseUserId);
    }

    @Override
    public int insertExpenseApplys(List<ExpenseApply> list) {
        return expenseApplyDao.insertExpenseApplys(list);
    }

    @Override
    public ExpenseApply getExpenseApplyById(Long id) {
        return expenseApplyDao.getExpenseApplyById(id);
    }

    @Override
    public ExpenseApplyDTO getExpenseApplyByUid(Long id, Long applyUserId) {
        return expenseApplyDao.getExpenseApplyByUid(id, applyUserId);
    }

    @Override
    public int updateExpenseApplys(Long operateUserId, byte status, String ids) {
        return expenseApplyDao.updateExpenseApplys(operateUserId, status ,ids);
    }

    @Override
    public List<StoreSimpleDTO> getToConfirmStoresByEUid(Long expenseUserId) {
        return expenseApplyDao.getToConfirmStoresByEUid(expenseUserId);
    }

    @Override
    public Integer getToConfirmCountByEUid(Long expenseUserId) {
        return expenseApplyDao.getToConfirmCountByEUid(expenseUserId);
    }

    @Override
    public List<ExpenseApplyDTO> getExpenseApplysByUid(Long applyUserId) {
        return expenseApplyDao.getExpenseApplysByUid(applyUserId);
    }

    @Override
    public List<ExpenseApply> getExpenseApplysByPid(Long applyUserId, Long parentId) {
        return expenseApplyDao.getExpenseApplysByPid(applyUserId, parentId);
    }

    @Override
    public List<UserDTO> getApplyUsersByExpenseUid(Long expenseUserId) {
        return expenseApplyDao.getApplyUsersByExpenseUid(expenseUserId);
    }

    @Override
    public List<ExpenseApplyDTO> getExpenseApplyByStatusUid(Long applyUserId, Long operateUserId, Byte status, int start, int count) {
        return expenseApplyDao.getExpenseApplyByStatusUid(applyUserId, operateUserId, status, start, count);
    }

    @Override
    public int getExpenseApplyCountByStatusUid(Long applyUserId, Long operateUserId, Byte status) {
        return expenseApplyDao.getExpenseApplyCountByStatusUid(applyUserId, operateUserId, status);
    }

    @Override
    public Store getStoreByApplyExpenseId(Long id) {
        return expenseApplyDao.getStoreByApplyExpenseId(id);
    }

    @Override
    public List<Map<String, Object>> getExpenseApplyList(String startDate, String endDate, Long storeId, Byte status) {
        return expenseApplyDao.getExpenseApplyList(startDate, endDate, storeId, status);
    }
}
